<template>
  <div>
    <button @click="changeTab">点击</button>
    <component :is="status"></component>
  </div>
</template>

<style lang="" scoped>
</style>

<script>
import demo4 from './Demo4'
export default {
  data () {
    return {
      status: 'demo4'
    }
  },
  methods: {
    changeTab () {
      this.status = 'test2'
    }
  },
  components: {
    demo4,
    'test1': {
      template: '<div>test1</div>'
    },
    'test2': {
      template: '<div>test2</div>'
    }
  }
}
</script>
